//! Implementation of the `/dev/null` pseudo-device.
//! `/dev/null` is a special device that discards all writes and returns EOF on reads.

comptime {
    @import("../driver.zig").register(&init, @typeName(@This()));
}

const os = @import("../os.zig");

fn init(_: ?*const anyopaque) void {
    os.fs.devsw[os.NULL].read = &read;
    os.fs.devsw[os.NULL].write = &write;
}

fn write(src: usize, len: usize) !usize {
    _ = src;
    return len;
}

fn read(dst: usize, nbytes: usize) !usize {
    _ = nbytes;
    _ = dst;

    return 0;
}
